<%--
  Created by IntelliJ IDEA.
  User: luoxinmin
  Date: 2020/9/12
  Time: 14:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
</head>
<body>
<script src="${pageContext.request.contextPath}/static/layui/layui.all.js"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.min.js"></script>

<table id="demo" lay-filter="test"></table>

<script type="text/javascript">
    layui.use('table', function () {
        var table = layui.table;
        //执行渲染
        table.render({
            page: true,
            url: '/student/all'
            , elem: '#demo' //指定原始表格元素选择器（推荐id选择器）
            , width: 1000 //容器高度
            , cols: [[ //标题栏
                {field: 'id', title: 'ID', width: 80}
                , {field: 'name', title: '用户名1', width: 120}
                , {field: 'pass', title: '用户名2', width: 120}
                , {field: 'sex', title: '用户名3', width: 120}
                , {field: 'department', title: '用户名4', width: 120}
                , {field: 'address', title: '用户名5', width: 120}
                , {field: 'birth', title: '用户名6', width: 120}
            ]] //设置表头
            //,…… //更多参数参考右侧目录：基本参数选项
        });
    });

</script>
</body>
</html>
